/*
 * Copyright 2008, James E. Kleckner

  This file is part of spread-excel.

  spread-excel is free software: you can redistribute it and/or modify
  it under the terms of the GNU Lesser General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  spread-excel is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef ExcelSpread_h_included
#define ExcelSpread_h_included

/* 
 * When building the DLL code, you should define BUILDING_DLL so that
 * the variables/functions are exported correctly. When using the DLL,
 * do NOT define BUILDING_DLL, and then the variables/functions will
 * be imported correctly.
 *
 * You need to be using egcs-1.1.1 or newer.
 *
 * Building the DLL:
 *  - define BUILDING_DLL, which defines DLLIMPORT __attribute__((dllexport))
 * Building the client code:
 *  - DO NOT define BUILDING_DLL, which defines DLLIMPORT to be one 
 *    __attribute__((dllimport))
 */

#if BUILDING_DLL
# define DLLIMPORT __declspec (dllexport)
#else /* Not BUILDING_DLL */
# define DLLIMPORT __declspec (dllimport)
#endif /* Not BUILDING_DLL */

/*
#if !defined(_NATIVE_WCHAR_T_DEFINED)
typedef unsigned short WCHAR;
#else
typedef wchar_t WCHAR;
#endif
#define pascal
#define WINAPI __stdcall
typedef int BOOL;
typedef void *HANDLE;
typedef unsigned long DWORD;
typedef void *PVOID,*LPVOID;
#define DLL_PROCESS_DETACH	0
#define DLL_PROCESS_ATTACH	1
#define DLL_THREAD_ATTACH	2
#define DLL_THREAD_DETACH	3
#define TRUE 1
*/

/*
*/
DLLIMPORT int pascal   ExcelSpreadPub_sp_connect(WCHAR** server, WCHAR** client);
DLLIMPORT int pascal   ExcelSpreadPub_sp_pub(WCHAR** topicName, WCHAR** topicData);
DLLIMPORT int pascal   ExcelSpreadPub_sp_connect_cp(char* server, char* client);
DLLIMPORT int pascal   ExcelSpreadPub_sp_pub_cp(char* topicName, char* topicData);

// Test functions for Excel
DLLIMPORT double pascal ExcelSpreadPub_square (double);
DLLIMPORT double pascal ExcelSpreadPub_count_strings (WCHAR**, WCHAR**);
DLLIMPORT void   pascal ExcelSpreadPub_concat_strings(WCHAR** retVal, WCHAR** s1, WCHAR** s2);
DLLIMPORT double pascal ExcelSpreadPub_double_string (WCHAR** s1,WCHAR** s2);
DLLIMPORT double pascal ExcelSpreadPub_charnum(long i,WCHAR** s1);

#endif /* ExcelSpread_h_included */

